package com.blackitheima2.LambdaDemo.test6;
//Lambda 表达式 抽象方法 带参带返回值
public class TestSum {
    public static void main(String[] args) {
        //匿名内部类
        getSum(new AddSum() {
            @Override
            public double getNumber(double x,double y) {
                return x+y;
            }
        });
        //Lambda 表达式
        getSum((x,y)->x+y);

    }
    public static void getSum(AddSum addSum){
        double sum=addSum.getNumber(3.5,5.6);
        System.out.println(sum);
    }
}
//接口
interface AddSum{
    public abstract double getNumber(double x,double y);
}
